// pages/h5page/index.js
const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    url: ""
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    console.log(options);
    if(options.url == 'sessionDetail.html'){
      this.toWebUrl(options);
    }else{
      this.setData({
        url: options.url
      })
    }
  },
  //网页跳传
  toWebUrl: function(options) {
    let url = options.url;
    switch (url) {
      case "sessionDetail.html":
        console.log('跳转网页');
        this.setData({
          url: app.globalData.webhost + url + '?' + decodeURIComponent(options.chatparam)
        })
        console.log(this.data.url);
        break;
      default:
        this.setData({
          url: decodeURIComponent(url)
        })
        break;
    }
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },
})